package com.dkd.flow.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dkd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.flow.mapper.EProcessDefinitionMapper;
import com.dkd.flow.domain.EProcessDefinition;
import com.dkd.flow.service.IEProcessDefinitionService;

/**
 * 流程定义Service业务层处理
 * 
 * @author itheima
 * @date 2025-01-26
 */
@Service
public class EProcessDefinitionServiceImpl extends ServiceImpl<EProcessDefinitionMapper, EProcessDefinition> implements IEProcessDefinitionService
{
    @Autowired
    private EProcessDefinitionMapper eProcessDefinitionMapper;

    /**
     * 查询流程定义
     * 
     * @param ID 流程定义主键
     * @return 流程定义
     */
    @Override
    public EProcessDefinition selectEProcessDefinitionByID(Long ID)
    {
        return eProcessDefinitionMapper.selectEProcessDefinitionByID(ID);
    }

    /**
     * 查询流程定义列表
     * 
     * @param eProcessDefinition 流程定义
     * @return 流程定义
     */
    @Override
    public List<EProcessDefinition> selectEProcessDefinitionList(EProcessDefinition eProcessDefinition)
    {
        return eProcessDefinitionMapper.selectEProcessDefinitionList(eProcessDefinition);
    }

    /**
     * 新增流程定义
     * 
     * @param eProcessDefinition 流程定义
     * @return 结果
     */
    @Override
    public int insertEProcessDefinition(EProcessDefinition eProcessDefinition)
    {
        eProcessDefinition.setCreateTime(DateUtils.getNowDate());
        return eProcessDefinitionMapper.insertEProcessDefinition(eProcessDefinition);
    }

    /**
     * 修改流程定义
     * 
     * @param eProcessDefinition 流程定义
     * @return 结果
     */
    @Override
    public int updateEProcessDefinition(EProcessDefinition eProcessDefinition)
    {
        eProcessDefinition.setUpdateTime(DateUtils.getNowDate());
        return eProcessDefinitionMapper.updateEProcessDefinition(eProcessDefinition);
    }

    /**
     * 批量删除流程定义
     * 
     * @param IDs 需要删除的流程定义主键
     * @return 结果
     */
    @Override
    public int deleteEProcessDefinitionByIDs(Long[] IDs)
    {
        return eProcessDefinitionMapper.deleteEProcessDefinitionByIDs(IDs);
    }

    /**
     * 删除流程定义信息
     * 
     * @param ID 流程定义主键
     * @return 结果
     */
    @Override
    public int deleteEProcessDefinitionByID(Long ID)
    {
        return eProcessDefinitionMapper.deleteEProcessDefinitionByID(ID);
    }
}
